make status return proper error codes