add document ready funciton as jquery was not working