Fix fps function