adjusted the try code block