Key file wasnt stored properly, as result was out of bounds

Signed-off-by: Kenny Millington <kenny@kennynet.co.uk>