added login protection