added code for adding records to database
but not working