minor changes on color changes. Added directory checking