Error handling and url route fix