fix issue where data might be unitialized
correctly check number of arguments