Added functionality for saving the ip address into the database.