handle null exception