fixed prompt bugs, added connect middleware