added additional check in wrapper