handling null exception