adding firebase event handling and value output