Fixes bug in switchPlayer