added methods to javascript clicked callback function