return error on val/4 failure