Bug Fix

Improvised The Key checking mechanism