change piecePressed method to send a command