Added a condition to check if the gpio directory is there and if not, set it up.