The problem was because the timer service cached the previous dlls. You have to restart timer service on all servers in the farm before starting any new deployment.
Sharepoint 2010
--------------------------------
net stop SPTimerV4
net start SPTimerV4
Sharepoint 2007
----------------------------------
net stop SPTimerV3
net start SPTimerV3
Sharepoint 2010
--------------------------------
net stop SPTimerV4
net start SPTimerV4
Sharepoint 2007
----------------------------------
net stop SPTimerV3
net start SPTimerV3