Changed to work on java 1.6