cleanup and add secure method