fix remove does not catch nullpointer