Updated with encryption