Incorrect removing and constains checking fixed