some checks for function and procedure misuse