some code corrections