safety & style

Built a safety into activity.php and small style updates.