Fixed an issue that prevents visit edit being saved properly