search array length fix and reverted user changes that were overwritten