Updated handler function usage to do safe calls