before adding end directive (simple)
added simple ending mechanic