fixed couple bugs