Moved js into controller