fixing bugs in bad sed
made stricter source commands