Update connection.py

Fixed the return value error.