Bug 2 Fixed

Added try catch loop in main.