if and attr fixes