updated notifications js to handle more edge cases and have more consistent ui