added error logging for handle template compiling