How to fix values not allowed errors