Added input validation for sharing + more security