modified code to comply with java 1.6