added login conditions to devide