Using sed instead of appending to the locals file. Should work much better