changes to select method, added exception handler