catching null exception