switch to output attribute and add observer