updated error messages and URL handling