mode update
made arg None by default
updated logic