Fixed codes style and  invalid variable