Fixed an error related to javascript onclick function