Finnaly working version of basic security after big hassle