record is added into the database table everytime instead of the user