fixed error messages and updated save functionality