committing before changing based on class