Added som try and catch blocks...