Fixed to work with jquery 1.9 (live function is deprecated in favour of using .on