bracket problem fixed in query