bugfixes and heroku ready