code refactor, removed printStackTrace() statement