addded listeners and sql base