Added callback instead of while True loop