fixed callback for valid dom building