added firebase code that works