fixed hasArgs to count correctly