fixed bugs from feedback