made a login chech function, fixed the problem where anyone could acsses the admin panel