handling null pointer