updated to support node 0.11 deprication