Updated to work with new jQuery