improved the order of parameters verification