modified to implement return value to other view controller but it begins to crash