fixes toggle not working on first click