added error handling
fully working get_num_pads tool