changes to prevent errors and redirects