added checks for version of os, 6.x working, 5.x not