Complement to Ekeland's variational principle and its applications