bug fixing

small bug fixes