handle null passed as error