CB-5117: helpful message, fix .then and java check
Fixed .then and java call