Add method to fetch last executed command