worked on try and catch statement