Added global check for function