fixed query error from converting to better syntax