made route method definition more robust