added java validation