Add catch exception
Fix some bugs
I think, works now fine :)