fixed functionality for directory viewer for user

Signed-off-by: Martin Säfsten <martin@safsten.se>