error check when query return null