fixed all the issues reported from the analyzer