fixing some code