updated to be a pre-compile hook