Weird characters displayed

Hi my friends, I have connected the LCD by 3 wire method using the LiquidCrystal595 library+74HC595 register shift and the code below, but sometimes hello world is displayed but other times it displays weird characters.

// include the library code:
#include <LiquidCrystal595.h>

// initialize the library with the numbers of the interface pins + the row count
// datapin, latchpin, clockpin, num_lines
LiquidCrystal595 lcd(8,9,10);

void setup() {
  // set up the LCD's number of columns and rows: 
  // Print a message to the LCD.
  lcd.print("hello world");

void loop() {

Cross posted here.