Solved trouble with exceptions! Thanks to randaalex