added support for warnings to try higher order function