Fixed arrayindexoutofbounds issue met lege replace