Fixed java 6 compatibility bug