fixed for jquery 1.7+