fixed tag filter SQL query
fixed tag parent deletion