added access to key via meta path
added flash for error message