added { and } after if and else, replace %y to %Y and other