checking if remove gives an error