added handler for pin