Added Type Checking Logic