Fixed template path and added append module path to main