store user activity in the database