change clearing to be first so any exceptions dont cause leftover data when it doesnt clear