fixed brainfart in mysql query