Fixed missed boolean check