fixed returning empty error code