fixed issue 13 and 15.