Fix plugin not working first time