added last method and saving id