Fixed for ubuntu, patch checking to avoid reapplying