Fixed the bug of not taking the last coin