Formatting
Added null check for context to prevent crashes