adds timeout option and persistance as an option