fixed two bugs from testing