fixed javascript function on dropdown menu