Added small delay to fix bug