fix max() bad usage