fixed the bug of not checking the type before cutting