add more specific error message for function check