I am trying to add a user into the database after hashing his email. I have created the following mongoose model. However, I keep getting TypeError: keyStore.createUser is not a function. 

```
    const bcrypt = require('bcrypt-nodejs');
    const crypto = require('crypto');
    const mongoose = require('mongoose');

    const KeyStoreSchema = new mongoose.Schema({
        email: { type: String, unique: true },
        key: String,
        endTime: Date
        });

    module.exports.createUser = function (email, callback) {
        bcrypt.genSalt(10, function (err, salt) {
            bcrypt.hash(newUser.email, salt, function (err, hash) {
                newUser.email = email;
                newUser.key = hash;
                var myDate = new Date("2 dec 2012 3:30:00"); // your date object
                console.log('Created key for user'+ newUser.email +'at time:'+myDate);
                // add 24 hours to the key
                myDate.setHours(myDate.getHours() + 24)
                newUser.endTime = myDate;
                newUser.save(callback);
            });
        });
    }

    module.exports.getUserByUsername = function (email, callback) {
        var query = { email: username };
        KeyStore.findOne(query, callback);
    }

    module.exports.getUserkey = function (email, callback) {
        var query = { email:username }
        KeyStore.findOne(query, 'key', callback);
    }

    const KeyStore = mongoose.model('KeyStore', KeyStoreSchema);

    module.exports = KeyStore;

```