fixed a bug in search method of java part