catch null pointer
cleanup