Check the return value from 'select' to check possible connection problems