Added security - need to tidy up code.