added error logs in java files