added sessions and connect to SQL db