fix observe when called before DOM is loaded

Refs #2