Fixed javascript not firing problems