Fixed recent promise error with JSHint