20140612

bug fix & code refactoring