minor fix
fixed #1034, search + rewrite issue
improvements