Fix layout drag and drop functionality