added main functon for running in heroku