removed unnecessary error check