fixes to make in work as chrome extension