added better error message handling to erp_app login