fixed bug & added version checking