Update the code to 0.5.1