Swapping wrong conditional