Fixing persintent connection