added $persistent parameter to the constructor