custom error improvements