Changed everything to javascript so there is no reloading