Getting rid of connect deprecation warnings and fixing error showing