fixed some bug issues