Fixed a bug, added a commented code block which needs error handling.