fixed mode check in wrapper