removed redundant error check