fixed issues with Java