fixed the warning thrown by array_pop expecting a writable var