some code fixed