fixed soql bug