fixed peek function for gpio