more bugs solved-using gdb