add undo feature and all data read from db