Added error handling for next deployment route