Shared pointers doesn't work