fix bug with calculating score