Fix bugs of part of calling gen-server