Fix activity logic