fixed synchronization in gpio-handler