Removed active document check
Added unit tests