limiting valid codes