Added lock on startup functionality