fixed bugs
bug fixes + error handling