Added code to store problem into db