fixes var name and adds console logs