fix slider position calculation