[+] Added smart pointer and catch block, but problems with memory management
[FIX] Fixed bug with smart pointer