finally fixed jquery bug