Added error handling when no schedule or no trains