fix for tickets 17 & 24