fixed type erasure on customer search
better implementation of the fix for type erasure