fixed problem with scroll position not being properly detected in firefox