pin functionality fixed