added error handling, added check if passed element has already been rendered, added minified file, refactoring, beautifying