Error in if block of build script