query, magging tuning. fix javascript bug(query is undefined).