bug #9 still happening after modifying this it starts working fine