added nosuch element exception hadndler