#1758: changes according to mkommend's reviewing comments have been made and catch blocks now only catch specific exceptions