Remove old function from note repository and resetting flag from posted entity