login restriction added and some necessary changes made