added much logging and added java check