Changed to try-statement