added argument checks