fixed some small  bugs