Fixed select() issue