added some bits for flask connectivity