Added dialog code