Switch-case in Dynamically created  file