some fixes to make it work on desktop and android