fixing some last minute bugs