Revert "bug fixes"

This reverts commit baff566d0454fda75e89e9fa4141c5d6c7478098.
small changes