Issue in release mode (infinite loop)