return proper errors