fixes try-catch in getString method