Dynamic functionality of lock unlock button