Adding exception handling for 'no implicit conversion' error