made functions secure