added validation of private and user key