fixing marker removal code