recompile only when necessary