refixed some code