repaired check for rest declaration method