fixing listing undefined behavior