added key functionality