return proper error