store task in database