fixed side switching as result of refactoring