once clicked on the link, move to video
minor changes to avoid null pointers and js functions