added insert to database and loading old tags