Updated version with working patch