re-added password checking logic