Fixed issue with viewDidAppear and removed compiler warning issue