Added dynamic event handler for boxes

fixed save bug - resets loop on save