fixes for firefox

fixes the buggy behaviour on firefox