javascript functions for heroku