added view controller function