added events and condtion restarted! angular way! nice
fixed potential bug with scopering