added cached functionality