fix bug with initial load