added on_empty hook
tidy