fixed bugs introduced in my previous commits