Fixed save issue. Added automatic mongodb collection and document creation. Replaced "SIGINT" handler with "exit" handler