added nullchecking for remove from list