removed code duplication
fix for only accepting one code