Validate secret_code in a different way

I do not know if this is okay, but it seems prettier to me