added function to return error status only