fixing some errors after saving