added pin-unpin button support (with db interaction)