Decomposition of thiazolidines in acidic and basic solution