previous fix was not java 6 compatible