style correction and remove extra error check