renamed, uses try and catch blocks