Adding semantic check of functions