added error checking for zero args