Added a check for OS

(Much better than your cousin's method, just saying)