fixed bugs in the pebble part