fixed bugs for testing