fixed bug: threw exception when passing null as second argument