removed redundant type-check