fixed bug with NULL arguments