simplifyed version - no polling