working code on activities