Added type checking
Merg