fixed bugs (memory problems)