bug fixes. make it work locally