Fixed bug with pin