Resolved deprecated code in the view controller