better error handling and fix share menu intent