added exception handle in TreeMap remove() function