check arguments.length instead of typeof delay