update database and complete,reject function