Avoid inserting high value than previous inserted value