Added logic for locale input