Works for java6