adding singleton constructor and cleaning modal js