fixed bug

Signed-off-by: James Paton <jpaton2@gmail.com>