Fixed a bug reported by Tsonka

Signed-off-by: plamen911 <plamen@lynxlake.org>