Fixed access check
Added missing database step